package org.chaiyi.template.core.common.util.asserts;

import java.time.LocalDateTime;

public class LocalDateTimeAssert {
    private final LocalDateTime value;

    LocalDateTimeAssert(LocalDateTime value) {
        this.value = value;
    }

    public boolean lt(LocalDateTime value) {
        return this.value.compareTo(value) < 0;
    }

    public boolean lte(LocalDateTime value) {
        return this.value.compareTo(value) <= 0;
    }

    public boolean gte(LocalDateTime value) {
        return this.value.compareTo(value) >= 0;
    }

    public boolean gt(LocalDateTime value) {
        return this.value.compareTo(value) > 0;
    }

    public boolean in(LocalDateTime from, LocalDateTime to) {
        return this.gte(from) && this.lte(to);
    }

    public boolean timeRange(LocalDateTime from, LocalDateTime to) {
        return this.gte(from) && this.lt(to);
    }
}

